package net.hxz.modules.controller.frontEnd;

import net.hxz.modules.controller.BaseController;
import net.hxz.modules.services.IBannerService;
import net.hxz.modules.services.ITextService;
import net.hxz.modules.services.ITypeService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 网站统一入口
 * @author OYJ
 */
@Controller
@RequestMapping(value="/text/")
public class TextController extends BaseController {

	@Autowired
	private IBannerService bannerService;
	
	@Autowired
	private ITextService textService;
	
	@Autowired
	private ITypeService typeService;
	
	@RequestMapping("text-{lang}")
	public String index(@PathVariable String lang, Long textId, ModelMap map) {
		map.put("text", textService.get(textId));

		map.put("lang", lang.equals("en") ? 0 : 1);
		map.put("jsp", "text/detail");
		
		return PHONE_MAIN_PATH;
	}
	
}
